-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Revised the conditional operator article #9125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revised the conditional operator article #9125
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @pkulikov. Your changes look really good. I've left a few comments and suggestions. But the final example isn't being included in the build, and I have no idea why. I'll close and reopen this PR to see if it mysteriously appears with the rebuild.
docs/csharp/language-reference/operators/conditional-operator.md
Outdated
Show resolved
Hide resolved
docs/csharp/language-reference/operators/conditional-operator.md
Outdated
Show resolved
Hide resolved
docs/csharp/language-reference/operators/conditional-operator.md
Outdated
Show resolved
Hide resolved
docs/csharp/language-reference/operators/conditional-operator.md
Outdated
Show resolved
Hide resolved
docs/csharp/language-reference/operators/conditional-operator.md
Outdated
Show resolved
Hide resolved
|
|
||
| Usage of the conditional operator over an [if-else](../keywords/if-else.md) statement might result in more concise code in cases when you need conditionally to compute a value. The following example demonstrates two ways to classify an integer as negative or nonnegative: | ||
|
|
||
| [!code-csharp[conditional and if-else](~/samples/snippets/csharp/language-reference/operators/ConditionalExamples.cs#CompareWithIf)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rpetrusha I also didn't notice any warnings even before the samples PR was merged. Does it build properly after merging the samples PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latest build shows no warnings, and the code appears as expected, @pkulikov
I have no idea of why one block of code was not found when the others were.
|
Closing and reopening to begin new build. |
|
@rpetrusha thanks for review; I've addressed your feedback. |

refkeyword article